Test bit example

If the variable, x, has the value 49, and bit number 5 is being tested against the state 'On', the test results in a positive outcome.

This is because the bit states of value 49 are as follows:

Bit no. 7 6 5 4 3 2 1 0
State Off Off On On Off Off Off On

See also: